/*
 * Powered By [rapid-framework]
 * Web Site: http://www.rapid-framework.org.cn
 * Google Code: http://code.google.com/p/rapid-framework/
 * Since 2008 - 2011
 */

package com.nail.zhaogr.service;

import java.util.List;

import javacommon.base.BaseManager;
import javacommon.base.EntityDao;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.org.rapid_framework.page.Page;

import com.nail.zhaogr.dao.MyContactDao;
import com.nail.zhaogr.model.MyContact;
import com.nail.zhaogr.vo.query.MyContactQuery;

/**
 * @author badqiu email:badqiu(a)gmail.com
 * @version 1.0
 * @since 1.0
 */

@Service
@Transactional
public class MyContactManager extends BaseManager<MyContact,java.lang.Long>{

	private MyContactDao myContactDao;
	/**增加setXXXX()方法,spring就可以通过autowire自动设置对象属性,请注意大小写*/
	public void setMyContactDao(MyContactDao dao) {
		this.myContactDao = dao;
	}
	public EntityDao getEntityDao() {
		return this.myContactDao;
	}
	
	public boolean isMemberTrade(MyContact psnTrade){
		 List list = myContactDao.getHibernateTemplate().findByExample(psnTrade);
		 if(list!=null&&list.size()>0){
			 return true;
		 }else{
			 return false;
		 }
	}
	
	@Transactional(readOnly=true)
	public Page findPage(MyContactQuery query) {
		return myContactDao.findPage(query);
	}
	
}
